package com.youhome.service.service;

import com.github.pagehelper.PageInfo;
import com.youhome.common.exception.CustomException;
import com.youhome.service.model.BShareGroup;
import com.youhome.service.model.BShareGroupHouse;
import com.youhome.service.model.BShareGroupItem;
import com.youhome.service.model.Principal;

import java.util.List;

/**
 * Created by chen365 on 2017/11/1.
 */
public interface BShareGroupService {

    void delete(String id) throws CustomException;

    BShareGroup selectByPrimaryKey(String shareId) throws CustomException;

//    BShareGroup selectByUUID(String uuid);
//
//    BShareGroup selectDetailByUUID(String uuid);

    PageInfo<BShareGroup> selectByBean(Principal principal, Integer pageNumber, Integer pageSize, Long counselorId, String name) throws CustomException;

    int create(Long counselorId, String shareGroupName);

    BShareGroup create(BShareGroup shareGroup);

    BShareGroupHouse addHouseAppendToShareGroup(String shareId, String houseId)throws CustomException;

    List<BShareGroupItem> selectAllByCounselorId(Long counselorId);

    void deleteHouse(String shareId, String houseId) throws CustomException;

    boolean existByHouseId(String shareId, String houseId);

    boolean exist(Long counselorId, String groupName);

    List<String> selectShareGroupNameByHouseIdAndCounselorId(Long counselorId, String houseId);

    int insert(BShareGroup bShareGroup);

    int updateByPrimaryKey(BShareGroup bShareGroup);

    int deleteByShareIdAndCounselorId(BShareGroup bShareGroup);

    PageInfo<BShareGroup> selectByBean(Integer pageNumber, Integer pageSize, BShareGroup record);

    BShareGroup createShareGroup(Principal principal, String shareGroupName) throws CustomException;

    List<BShareGroupItem> selectAllShareGroup(Principal principal) throws CustomException;;

    void deleteByShareIdAndCounselorId(String phone, String shareId) throws CustomException;

    void updateByBean(String phone,BShareGroup record) throws CustomException;

    void addShareGroupHits(String shareId) throws CustomException;
}
